<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>更改仓库</title>
<link rel="shortcut icon" href="${ctx}/favicon.ico"> <link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${ctx}/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="${ctx}/css/animate.css" rel="stylesheet">
    <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
</head>
<body>
<form >
	<div style="text-algin:center;margin-top:30px;width:100%;height:50;">
		 <label  style="font-size:18px;width:220px;float:left;margin-top:5px;margin-left:20px;font-weight:normal;">为${goodsId}号商品选择新仓库：</label>
		<div style="width:150px;float:left;">
		    <select class="form-control" name="storehouseId">
		        <c:forEach var="storehouse" items="${storehouseList}">
	                  <c:if test="${storehouse.storehouse_id==10}">
	                    		
	                   </c:if>
	                   <c:if test="${storehouse.storehouse_id!=10}">
	                    	<option value="${storehouse.storehouse_id}">${storehouse.storehouse_name}</option>
	                   </c:if>
	            </c:forEach>  
		    </select>
		</div>
		<div style="float:left;font-weight:700px;margin-left:10px;font-size:17px;" class="btn btn-sm btn-white" type="submit" onclick="inStorehouse(${goodsId})">确定入库</div>
	</div>
</form>
	
</body>
 <!-- 全局js -->
    <script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
    <script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="${ctx}/dist\layer-v3.1.1\layer\layer.js"></script>
    
    <script type="text/javascript">
    	function inStorehouse(goodsId){
    		$.get('${ctx}/HouseGoodsServlet/updateNewStorehouse?goodsId='+goodsId,$('form').serialize(),function(data){
    			if(data){	
    				alert("更改成功");
					//parent.layer.msg('入库成功');	
        			window.parent.location.reload();//刷新父页面
    				parent.layer.close(index);//关闭当前的弹窗
				}else{
					alert("更改失败");
					//parent.layer.msg('入库失败');
					window.parent.location.reload();//刷新父页面
					parent.layer.close(index);//关闭当前的弹窗
				}
        	});
    	}
    </script>
</html>